<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html 
	xmlns="http://www.w3.org/1999/xhtml" 
	xmlns:h="http://java.sun.com/jsf/html" 
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j" 
	xmlns:rich="http://richfaces.org/rich" 
	xmlns:fn="http://java.sun.com/jsp/jstl/functions">

	 <h:outputStylesheet>
        .label {
        font-weight: bold;
        }
        .rf-dg, .rf-dg-c{
        border:none;
        }
        .pbody {
        width: 200px;
        }
    </h:outputStylesheet>

	<rich:panel header="#{msg.schedule_control}" rendered="#{scheduleManageBean.status == 'SEARCH'}">
		<br />
		
		<rich:panel header="#{msg.search_criteria}">
			<h:outputText value="#{msg.search_criteria}" />
			<h:outputText value=": " />
			<h:outputText value="#{scheduleManageBean.searchDescription}" />
		</rich:panel>
		
		<br />
		
		<rich:panel header="#{msg.select} - #{msg.machine}">
		
			<h:outputText value="#{msg.no_record_found}" rendered="#{empty scheduleManageBean.clickedMachineOptions}" />					
			
			<h:outputText value="&#160;" rendered="#{not empty scheduleManageBean.clickedMachineOptions}" />
			
			<a4j:commandLink style="font-size: 12px;"
				value="#{msg.select_all}" rendered="#{not empty scheduleManageBean.clickedMachineOptions}"
				action="#{scheduleManageBean.selectAll}" render="@form"/>
				
			<h:outputText value="&#160;" rendered="#{not empty scheduleManageBean.clickedMachineOptions}" />		
			<h:outputText value="&#160;" rendered="#{not empty scheduleManageBean.clickedMachineOptions}"/>
				
			<a4j:commandLink style="font-size: 12px;" 
				value="#{msg.clear}" rendered="#{not empty scheduleManageBean.clickedMachineOptions}"
				action="#{scheduleManageBean.clearAll}" render="@form"/>	
											
			<br />
			
			<rich:dataGrid id="machineList" rendered="#{not empty scheduleManageBean.clickedMachineOptions}"
				value="#{scheduleManageBean.clickedMachineOptions}" var="item" columns="8" elements="24" width="800px" >				
					
				<h:selectBooleanCheckbox value="#{scheduleManageBean.clickedMachineIdMap[item.value]}" onclick="updateClickedMachine('#{item.value}')">
														
					<a4j:ajax event="click" render="@form" listener="#{scheduleManageBean.updateMachineIdList}" />						 									
					
				</h:selectBooleanCheckbox>				
				
				<h:outputText style="font-size:12px" value="#{item.label}" />															
																			
				<f:facet name="footer">
                    <rich:dataScroller />
                </f:facet>			
			</rich:dataGrid>
			
			<br />	
			
			<a4j:commandButton styleClass="buttonClass" style="font-size: 16px;" 
				value="#{msg.back}" action="#{scheduleManageBean.init}" 
				render="@form" />
			
			<h:outputText value="&#160;" rendered="#{not empty scheduleManageBean.clickedMachineOptions}" />		
			<h:outputText value="&#160;" rendered="#{not empty scheduleManageBean.clickedMachineOptions}"/>
			 
			<a4j:commandButton styleClass="buttonClass" style="font-size: 16px;"
				value="#{msg.select}" action="#{scheduleManageBean.selectDetail}"
				render="@form" rendered="#{not empty scheduleManageBean.clickedMachineOptions}" />
				
		</rich:panel>
		
	</rich:panel>
	
	<a4j:jsFunction name="updateClickedMachine"> 
    	<a4j:param name="param1" assignTo="#{scheduleManageBean.clickedMachineId}"/> 		
	</a4j:jsFunction>	 	
		
</html>